package com.sys.midware.memcached;

import java.util.Collection;
import java.util.Map;

import javax.annotation.PostConstruct;

public class MemCachedServiceImpl implements IMemCachedService {

	private BMemcachedClient client;


	@PostConstruct
	public void init() throws Exception {
		client = new BMemcachedClient();
	}

	@Override
	public void put(String key, Object value) throws Exception {
		client.put(key, value, 999);
	}

	@Override
	public <T> T get(String key) throws Exception {
		return client.get(key);
	}

	@Override
	public void put(Map<? extends Object, ? extends Object> map)
			throws Exception {
		client.put(map, 999);
	}

	@Override
	public <T> Map<String, T> get(Collection<String> keys) throws Exception {
//		return client.get(keys);
	    return null;
	}

	@Override
	public void remove(String key) throws Exception {
		client.remove(key);
	}

	@Override
	public void remove(Collection<String> keys) throws Exception {
//		client.remove(keys);
	}

	@Override
	public void put(String key, Object value, int expiredTimeInSeconds)
			throws Exception {
		client.put(key, value, expiredTimeInSeconds);
	}

	@Override
	public void put(Map<? extends Object, ? extends Object> map,
			int expiredTimeInSeconds) throws Exception {
		client.put(map, expiredTimeInSeconds);
	}

}
